<?php

namespace app\admin\controller;

use app\admin\logic\GenerateLogic;
use support\Backend\BackendController;
use support\Container;
use support\Response;

class GenerateController extends BackendController
{
    public function __construct()
    {
        parent::__construct();
        $this->logic = Container::get(GenerateLogic::class);
    }


    /**
     * 字段列表
     * @return Response
     */
    public function column(): Response
    {

        return success($this->logic->getColumnList());
    }

    /**
     * 字段配置
     * @return Response
     */
    public function setColumn(): Response
    {
        return success($this->logic->setColumn());
    }

    /**
     * 预览代码
     * @return Response
     */
    public function preview(): Response
    {
        return success($this->logic->genPreview());
    }

    /**
     * 下载代码
     * @return Response
     */
    public function code(): Response
    {
        return success($this->logic->createCodeDownload());
    }


}